bitkeeper revision 1.1668.1.1 (42a4842f6oumXgOUTTVUMx7uABT97w)
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Mon, 6 Jun 2005 17:13:19 +0000 (17:13 +0000)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Mon, 6 Jun 2005 17:13:19 +0000 (17:13 +0000)
More hyperprivop stuff
Signed-off by : Dan Magenheimer <dan.magenheimer@hp.com>

1  2 
xen/arch/ia64/asm-offsets.c
xen/arch/ia64/domain.c
xen/arch/ia64/privop.c
xen/arch/ia64/process.c
xen/arch/ia64/regionreg.c
xen/include/asm-ia64/domain.h
xen/include/public/arch-ia64.h

index 56847d15dc546b75671354d3dc4b60cb0b325427,d2e5fcff4e6e691544527288e26585a21f3235ac..6fe71039db132deefd8791856133274d366718af
@@@ -61,9 -66,14 +67,14 @@@ void foo(void
        //DEFINE(IA64_TASK_SIGHAND_OFFSET,offsetof (struct task_struct, sighand));
        //DEFINE(IA64_TASK_SIGNAL_OFFSET,offsetof (struct task_struct, signal));
        //DEFINE(IA64_TASK_TGID_OFFSET, offsetof (struct task_struct, tgid));
 -      DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct exec_domain, arch._thread.ksp));
 -      DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct exec_domain, arch._thread.on_ustack));
 +      DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct vcpu, arch._thread.ksp));
 +      DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct vcpu, arch._thread.on_ustack));
  
 -      DEFINE(IA64_VCPU_META_RR0_OFFSET, offsetof (struct exec_domain, arch.metaphysical_rr0));
 -      DEFINE(IA64_VCPU_META_SAVED_RR0_OFFSET, offsetof (struct exec_domain, arch.metaphysical_saved_rr0));
 -      DEFINE(IA64_VCPU_BREAKIMM_OFFSET, offsetof (struct exec_domain, arch.breakimm));
 -      DEFINE(IA64_VCPU_IVA_OFFSET, offsetof (struct exec_domain, arch.iva));
++      DEFINE(IA64_VCPU_META_RR0_OFFSET, offsetof (struct vcpu, arch.metaphysical_rr0));
++      DEFINE(IA64_VCPU_META_SAVED_RR0_OFFSET, offsetof (struct vcpu, arch.metaphysical_saved_rr0));
++      DEFINE(IA64_VCPU_BREAKIMM_OFFSET, offsetof (struct vcpu, arch.breakimm));
++      DEFINE(IA64_VCPU_IVA_OFFSET, offsetof (struct vcpu, arch.iva));
        BLANK();
  
        //DEFINE(IA64_SIGHAND_SIGLOCK_OFFSET,offsetof (struct sighand_struct, siglock));
index 144a4f149b6b97e008af085da0cf1a5591152fe5,cc879a4f6fbdff9853fd4b91970cf130f6ef453c..28ddf0b94b7bd419e9d29709543308060b9df59d
@@@ -244,9 -244,11 +244,11 @@@ void arch_do_createdomain(struct vcpu *
        }
  #endif
        d->max_pages = (128*1024*1024)/PAGE_SIZE; // 128MB default // FIXME
-       if ((d->metaphysical_rid = allocate_metaphysical_rid()) == -1UL)
+       if ((d->arch.metaphysical_rr0 = allocate_metaphysical_rr0()) == -1UL)
                BUG();
 -      ed->vcpu_info->arch.metaphysical_mode = 1;
 -      ed->arch.metaphysical_rr0 = d->arch.metaphysical_rr0;
 -      ed->arch.metaphysical_saved_rr0 = d->arch.metaphysical_rr0;
 +      v->vcpu_info->arch.metaphysical_mode = 1;
++      v->arch.metaphysical_rr0 = d->arch.metaphysical_rr0;
++      v->arch.metaphysical_saved_rr0 = d->arch.metaphysical_rr0;
  #define DOMAIN_RID_BITS_DEFAULT 18
        if (!allocate_rid_range(d,DOMAIN_RID_BITS_DEFAULT)) // FIXME
                BUG();
index 19ff98fc8daed3cfdb11f66f53c15a19379d04d4,c989eb1cbcbe599e8d12bdc57bd7c6498176970e..6737d514464e0c123f278a58e20f19dcd85149a3
@@@ -771,19 -772,19 +772,19 @@@ ia64_hyperprivop(unsigned long iim, REG
                printf("bad hyperprivop; ignored\n");
                return 1;
        }
-       hyperpriv_cnt[iim]++;
+       slow_hyperpriv_cnt[iim]++;
        switch(iim) {
            case HYPERPRIVOP_RFI:
 -              (void)vcpu_rfi(ed);
 +              (void)vcpu_rfi(v);
                return 0;       // don't update iip
            case HYPERPRIVOP_RSM_DT:
 -              (void)vcpu_reset_psr_dt(ed);
 +              (void)vcpu_reset_psr_dt(v);
                return 1;
            case HYPERPRIVOP_SSM_DT:
 -              (void)vcpu_set_psr_dt(ed);
 +              (void)vcpu_set_psr_dt(v);
                return 1;
            case HYPERPRIVOP_COVER:
 -              (void)vcpu_cover(ed);
 +              (void)vcpu_cover(v);
                return 1;
            case HYPERPRIVOP_ITC_D:
                inst.inst = 0;
                return 1;
            case HYPERPRIVOP_ITC_I:
                inst.inst = 0;
 -              (void)priv_itc_i(ed,inst);
 +              (void)priv_itc_i(v,inst);
                return 1;
+           case HYPERPRIVOP_SSM_I:
+               (void)vcpu_set_psr_i(ed);
+               return 1;
        }
        return 0;
  }
index 414880882a221348b4070cfed9b31cb2dd63a63f,f1655b25809d4940545014137c03c94d1bb43ec1..70bdbcebe56a68d2b1c04d71fc446391853d4e4f
@@@ -130,12 -130,48 +130,48 @@@ unsigned long translate_domain_mpaddr(u
        return ((pteval & _PAGE_PPN_MASK) | (mpaddr & ~PAGE_MASK));
  }
  
+ unsigned long slow_reflect_count[0x80] = { 0 };
+ unsigned long fast_reflect_count[0x80] = { 0 };
+ #define inc_slow_reflect_count(vec) slow_reflect_count[vec>>8]++;
+ void zero_reflect_counts(void)
+ {
+       int i;
+       for (i=0; i<0x80; i++) slow_reflect_count[i] = 0;
+       for (i=0; i<0x80; i++) fast_reflect_count[i] = 0;
+ }
+ int dump_reflect_counts(char *buf)
+ {
+       int i,j,cnt;
+       char *s = buf;
+       s += sprintf(s,"Slow reflections by vector:\n");
+       for (i = 0, j = 0; i < 0x80; i++) {
+               if (cnt = slow_reflect_count[i]) {
+                       s += sprintf(s,"0x%02x00:%10d, ",i,cnt);
+                       if ((j++ & 3) == 3) s += sprintf(s,"\n");
+               }
+       }
+       if (j & 3) s += sprintf(s,"\n");
+       s += sprintf(s,"Fast reflections by vector:\n");
+       for (i = 0, j = 0; i < 0x80; i++) {
+               if (cnt = fast_reflect_count[i]) {
+                       s += sprintf(s,"0x%02x00:%10d, ",i,cnt);
+                       if ((j++ & 3) == 3) s += sprintf(s,"\n");
+               }
+       }
+       if (j & 3) s += sprintf(s,"\n");
+       return s - buf;
+ }
  void reflect_interruption(unsigned long ifa, unsigned long isr, unsigned long itiriim, struct pt_regs *regs, unsigned long vector)
  {
 -      unsigned long vcpu_get_ipsr_int_state(struct exec_domain *,unsigned long);
 -      unsigned long vcpu_get_rr_ve(struct exec_domain *,unsigned long);
 +      unsigned long vcpu_get_ipsr_int_state(struct vcpu *,unsigned long);
 +      unsigned long vcpu_get_rr_ve(struct vcpu *,unsigned long);
        struct domain *d = current->domain;
 -      struct exec_domain *ed = current;
 +      struct vcpu *v = current;
  
        if (vector == IA64_EXTINT_VECTOR) {
                
@@@ -161,10 -197,11 +197,11 @@@ panic_domain(regs,"psr.ic off, deliveri
                }
  //printf("Delivering NESTED DATA TLB fault\n");
                vector = IA64_DATA_NESTED_TLB_VECTOR;
 -              regs->cr_iip = ((unsigned long) PSCBX(ed,iva) + vector) & ~0xffUL;
 +              regs->cr_iip = ((unsigned long) PSCBX(v,iva) + vector) & ~0xffUL;
                regs->cr_ipsr = (regs->cr_ipsr & ~DELIVER_PSR_CLR) | DELIVER_PSR_SET;
  // NOTE: nested trap must NOT pass PSCB address
 -              //regs->r31 = (unsigned long) &PSCB(ed);
 +              //regs->r31 = (unsigned long) &PSCB(v);
+               inc_slow_reflect_count(vector);
                return;
  
        }
  #endif
        regs->r31 = &((shared_info_t *)SHAREDINFO_ADDR)->vcpu_data[0].arch;
  
 -      PSCB(ed,interrupt_delivery_enabled) = 0;
 -      PSCB(ed,interrupt_collection_enabled) = 0;
 +      PSCB(v,interrupt_delivery_enabled) = 0;
 +      PSCB(v,interrupt_collection_enabled) = 0;
+       inc_slow_reflect_count(vector);
  }
  
  void foodpi(void) {}
index 6742d4f602d44a9906a7787c33539683080d1263,f82471cc02de700f7e818d11ee7c58b58f0e552b..cea0d6891eb40cd2ea72508faa73ff638d638545
@@@ -321,20 -324,19 +324,21 @@@ void init_all_rr(struct vcpu *v
  {
        ia64_rr rrv;
  
 +      rrv.rrval = 0;
 +      rrv.rid = v->domain->metaphysical_rid;
+       rrv.rrval = ed->domain->arch.metaphysical_rr0;
        rrv.ps = PAGE_SHIFT;
        rrv.ve = 1;
 -if (!ed->vcpu_info) { printf("Stopping in init_all_rr\n"); dummy(); }
 -      ed->vcpu_info->arch.rrs[0] = -1;
 -      ed->vcpu_info->arch.rrs[1] = rrv.rrval;
 -      ed->vcpu_info->arch.rrs[2] = rrv.rrval;
 -      ed->vcpu_info->arch.rrs[3] = rrv.rrval;
 -      ed->vcpu_info->arch.rrs[4] = rrv.rrval;
 -      ed->vcpu_info->arch.rrs[5] = rrv.rrval;
 +if (!v->vcpu_info) { printf("Stopping in init_all_rr\n"); dummy(); }
 +      v->vcpu_info->arch.rrs[0] = -1;
 +      v->vcpu_info->arch.rrs[1] = rrv.rrval;
 +      v->vcpu_info->arch.rrs[2] = rrv.rrval;
 +      v->vcpu_info->arch.rrs[3] = rrv.rrval;
 +      v->vcpu_info->arch.rrs[4] = rrv.rrval;
 +      v->vcpu_info->arch.rrs[5] = rrv.rrval;
        rrv.ve = 0; 
 -      ed->vcpu_info->arch.rrs[6] = rrv.rrval;
 -//    ed->shared_info->arch.rrs[7] = rrv.rrval;
 +      v->vcpu_info->arch.rrs[6] = rrv.rrval;
 +//    v->shared_info->arch.rrs[7] = rrv.rrval;
  }
  
  
@@@ -372,12 -374,10 +376,13 @@@ unsigned long load_region_regs(struct v
        // TODO: These probably should be validated
        unsigned long bad = 0;
  
 -      if (ed->vcpu_info->arch.metaphysical_mode) {
 +      if (v->vcpu_info->arch.metaphysical_mode) {
                ia64_rr rrv;
  
 -              rrv.rrval = ed->domain->arch.metaphysical_rr0;
 +              rrv.rrval = 0;
 +              rrv.rid = v->domain->metaphysical_rid;
 +              rrv.ps = PAGE_SHIFT;
++              rrv.rrval = v->domain->arch.metaphysical_rr0;
                rrv.ve = 1;
                rr0 = rrv.rrval;
                set_rr_no_srlz(0x0000000000000000L, rr0);
Simple merge
Simple merge